<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <composite:interface>

    </composite:interface>

    <composite:implementation>

        <h:outputStylesheet library="css" name="bootstrap.min.css" />


        <h:dataTable value="#{alertsBean.alerts}" var="o" 
                     styleClass="table table-striped"
                     >

            <h:column>
                <!-- column header -->
                <f:facet name="header">Nome</f:facet>
                <!-- row record -->
                #{o.nome}
            </h:column>

            <h:column>
                <f:facet name="header">Descrição</f:facet>
                    #{o.descricao}
            </h:column>

            <h:column>
                <f:facet name="header">Dia de Semana</f:facet>
                    #{o.diaSemana}
            </h:column>

            <h:column>
                <f:facet name="header">Hora Início</f:facet>
                    #{o.hora}
            </h:column>
            
            <h:column>
                <f:facet name="header">Hora Fim</f:facet>
                    #{o.horaFim}
            </h:column>

            <h:column>
                <f:facet name="header">Activo</f:facet>
                    #{o.activo}
            </h:column>
            <h:column>
                <f:facet name="header">Alerta de Voz</f:facet>
                    #{o.voice}
            </h:column>

            <h:column>

                <f:facet name="header">Acção</f:facet>

                <h:commandLink value="Apagar" action="#{alertsBean.eraseAlert(o)}" />

            </h:column>

        </h:dataTable>

    </composite:implementation>
</html>
